<% if user_signed_in? %>
  <li class="group">
    <div>
      <%=current_user.user_name%>，欢迎回来。
    </div>  
    <%= link_to "退出登陆", destroy_user_session_path, 
      :method => :delete,:id=>"logout-link",:class=>"login-bar-links" %>
    <a href="/posts" title="后台管理" class="login-bar-links" id="board-link">后台管理</a>
  </li>
<% else %>
  <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
    <%= f.label :user_name,"账号" %><%= f.text_field :user_name %><br />
    <%= f.label :password,"密码" %><%= f.password_field :password %><br />
    <%= f.check_box :remember_me %>
    <%= f.label :remember_me,"保存登陆" %>
    <%= f.submit '登陆' %>
    <%= link_to "忘记密码?", new_password_path('user') %>
  <% end %>
<% end %>
